﻿function ValidatorUpdateDisplay(val)
 {
    if (typeof(val.display) == "string") {
        if (val.display == "None") {
            return;
        }
        if (val.display == "Dynamic") 
        {
             //val.style.display = val.isvalid ? "none" : "inline";
            //return;
        }
    }
    if ((navigator.userAgent.indexOf("Mac") > -1) &&
        (navigator.userAgent.indexOf("MSIE") > -1)) {
        val.style.display = "inline";
    }
      if(val.isvalid == false)
     {
         alert(val.innerText);
     }
   //val.style.visibility = val.isvalid ? "hidden" : "visible";
} 

function Page_ClientValidate(validationGroup) 
{
    Page_InvalidControlToBeFocused = null;
    if (typeof(Page_Validators) == "undefined") 
    {
        return true;
    }
    var i;
    for (i = 0; i < Page_Validators.length; i++)
    {
        ValidatorValidate(Page_Validators[i], validationGroup, null);
        //新添加代码 S
        if(!Page_Validators[i].isvalid)// only show one  errmsg
       {
            Page_IsValid = false;
            Page_BlockSubmit = !Page_IsValid;
            return false;
        }
        //新添加代码 E
    }
    ValidatorUpdateIsValid();
    ValidationSummaryOnSubmit(validationGroup);
    Page_BlockSubmit = !Page_IsValid;
    return Page_IsValid;
}